I can view build results using the RTC eclipse client, but not with browser com.ibm.team.build.viewResult
https://rtc_instance:9443/jazz/web/projects/project1#action=com.ibm.team.build.viewResult&id=_OqxDUFBfEeOzj-1HuY57ug
I get he result title but nothing else, no error is reported in the browser.
When I hover on the build result in the browser, the result's information appears.
2 answers
Comments
I did see that in one of the examples, but com.ibm.team.build.internal.publishing does not exists in
RTC 3 java api I can not import it.
I have the same problem with com.ibm.team.build.linktype
Is their a diffferent way, or am I missing something in the SDK
I also can not find them in the java api doc
Sorry, that code is in the com.ibm.team.build.toolkit plugin, which is in the 4.x SDK but was omitted from the 3.x SDK. See next answer for the relevant code.
Here's the code I mentioned above.
private void tagWorkItems(IWorkItemHandle[] workItemHandles, IBuildResult buildResult,
ITeamRepository teamRepository) throws TeamRepositoryException {
ILinkManager linkManager = (ILinkManager) teamRepository.getClientLibrary(ILinkManager.class);
List unlinkedWorkItems = findUnlinkedWorkItems(workItemHandles, buildResult, linkManager);
List links = new ArrayList();
List workItems = teamRepository.itemManager().fetchCompleteItems(unlinkedWorkItems, IItemManager.REFRESH, null);
for (int i = 0; i < unlinkedWorkItems.size(); ++i) {
IWorkItemHandle workItemHandle = (IWorkItemHandle) unlinkedWorkItems.get(i);
IWorkItem workItem = (IWorkItem) workItems.get(i);
links.add(createLink(teamRepository, workItemHandle, workItem, buildResult));
}
linkManager.saveLinks(links, null);
}
throws TeamRepositoryException {
IBuildDefinition definition = (IBuildDefinition) teamRepository.itemManager().fetchCompleteItem(
result.getBuildDefinition(), IItemManager.DEFAULT, null);
IHelperType helperType = IHelperType.IRegistry.INSTANCE.getHelperType(
LinksPackage.eINSTANCE.getReference().getName(), LinksPackage.eNS_URI);
String sourceComment = ItemHelper.validateStringAttributeLength(definition.getId() + " " + result.getLabel(), //$NON-NLS-1$
helperType, LinksPackage.eINSTANCE.getReference_Comment().getName());
IReference source = IReferenceFactory.INSTANCE.createReferenceToItem(result, sourceComment);
IReference target;
if (workItem == null) {
// work item is missing or invisible, so create a link but provide no comment
target = IReferenceFactory.INSTANCE.createReferenceToItem(workItemHandle);
} else {
String targetComment = ItemHelper.validateStringAttributeLength(
WorkItemTextUtilities.getWorkItemText(workItem), helperType,
LinksPackage.eINSTANCE.getReference_Comment().getName());
target = IReferenceFactory.INSTANCE.createReferenceToItem(workItemHandle, targetComment);
}
return ILinkFactory.INSTANCE.createLink(BuildLinkTypes.INCLUDED_WORK_ITEMS, source, target);
}
Comments
public static final String INCLUDED_WORK_ITEMS = "com.ibm.team.build.linktype.includedWorkItems"; //$NON-NLS-1$
It works
just a side note if I removed a build result using the gui, it does not remove the link form the workitem
I go to the workitem and I can not remove the link using the gui
Is their no way using the gui to remove the link?
Good to hear. Regarding the links, no there's no way to delete them. The intent is that you may still want to know which builds a work item's change sets were included in, even if the referenced build has been deleted.
Comments
K M
Nov 26 '13, 3:59 p.m.when I use the eclipse gui, it reports the build result has no start request. Can this be the problem?
Is their any way of debuging this problem?
K M
Nov 26 '13, 4:00 p.m.If I add a IBuildRequest buildRequest, I can now see most of the the build results
All except workitems associated with the results.
K M
Nov 26 '13, 4:00 p.m.I add the work items to the result using
contribution = BuildItemFactory.createBuildResultContribution();
contribution.setExtendedContributionTypeId(WorkItemConstants.EXTENDED_DATA_TYPE_ID);
contribution.setImpactsPrimaryResult(false);
if ((handleIds != null) && (handleIds.length != 0)) {
contribution.setExtendedContributionData(ContentUtil.stringArrayToContent(repo, handleIds,'\n'));
}
result = buildClient.addBuildResultContribution(result, contribution,IBuildResult.PROPERTIES_COMPLETE, null);
I do not link the work item to the build result